4be23b620652584cecec80237aa6a893302d8057,src/main/java/cn/edu/buaa/crypto/encryption/hibe/bbg05/serialization/HIBEBBG05XMLSerializer.java,HIBEBBG05XMLSerializer,ciphertextParametersSerialization,#HIBEBBG05CiphertextParameters#,190
Before Change
schemeElement.setAttribute(PairingParameterXMLSerializer.ATTRI_LENGTH, Integer.toString(ciphertextParameters.getLength()));
ciphertextDocument.appendChild(schemeElement);
//Set B
Element bElement = ciphertextDocument.createElement(HIBEBBG05XMLSerializer.TAG_CT_B);
String bString = new String(Hex.encode(ciphertextParameters.getB().toBytes()));
Text bText = ciphertextDocument.createTextNode(bString);
schemeElement.appendChild(bElement);
bElement.appendChild(bText);
//Set C
Element cElement = ciphertextDocument.createElement(HIBEBBG05XMLSerializer.TAG_CT_C);
String cString = new String(Hex.encode(ciphertextParameters.getC().toBytes()));
Text cText = ciphertextDocument.createTextNode(cString);
schemeElement.appendChild(cElement);
cElement.appendChild(cText);
return ciphertextDocument;
} catch (ParserConfigurationException e) {
e.printStackTrace();
After Change
private Document ciphertextParametersSerialization(HIBEBBG05CiphertextParameters ciphertextParameters){
try {
Document ciphertextDocument = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
Element schemeElement = ciphertextDocument.createElement(HIBEBBG05XMLSerializer.TAG_SCHEME_NAME);
schemeElement.setAttribute(PairingParameterXMLSerializer.ATTRI_TYPE, PairingParameterXMLSerializer.TYPE_CT);
schemeElement.setAttribute(PairingParameterXMLSerializer.ATTRI_LENGTH, Integer.toString(ciphertextParameters.getLength()));
ciphertextDocument.appendChild(schemeElement);
//Set B
SerializationUtils.SetElement(ciphertextDocument, schemeElement, TAG_CT_B, ciphertextParameters.getB());
//Set C
SerializationUtils.SetElement(ciphertextDocument, schemeElement, TAG_CT_C, ciphertextParameters.getC());
return ciphertextDocument;